package com.helmlabs.grouper.finance.model;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

@Entity
public class MembershipDueSchedule {
	
	private Long id;
	private String name;
	private Date beginOfferingOn;
	private Date endOfferingOn;
	private Date membershipStartsDate;
	private Date membershipEndsDate;
	private List<MembershipDueRate> rates;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Date getBeginOfferingOn() {
		return beginOfferingOn;
	}
	public void setBeginOfferingOn(Date beginOfferingOn) {
		this.beginOfferingOn = beginOfferingOn;
	}
	public Date getEndOfferingOn() {
		return endOfferingOn;
	}
	public void setEndOfferingOn(Date endOfferingOn) {
		this.endOfferingOn = endOfferingOn;
	}
	public Date getMembershipStartsDate() {
		return membershipStartsDate;
	}
	public void setMembershipStartsDate(Date membershipStartsDate) {
		this.membershipStartsDate = membershipStartsDate;
	}
	public Date getMembershipEndsDate() {
		return membershipEndsDate;
	}
	public void setMembershipEndsDate(Date membershipEndsDate) {
		this.membershipEndsDate = membershipEndsDate;
	}
	@OneToMany(mappedBy="schedule", fetch=FetchType.EAGER)
	public List<MembershipDueRate> getRates() {
		return rates;
	}
	public void setRates(List<MembershipDueRate> rates) {
		this.rates = rates;
	}
	public String toString(){
		return super.toString() + " {name=" + getName() + ",beginOfferingOn=" + getBeginOfferingOn() + ",rates=" + getRates() + "}";
	}
	

}
